import * as actionTypes from './constants';

const defaultState = {
    mainData:[],
    index:0
}

const reducer = (state = defaultState,action)=>{
    switch(action.type){
        case actionTypes.GET_MAINDATA:
            return{
                ...state,
                mainData:action.data
            }
        case actionTypes.SET_INDEX:
            return{
                ...state,
                index:action.data
            }
        default:
            return state
    }
}

export default reducer